/**
 * @file plugin-element-plus
 * @author shenyc
 * @description 注册全局 element plus & icons
 */
import type { App } from "vue";
import ElementPlus from "element-plus";
import * as ElementPlusIcons from "@element-plus/icons-vue";

// element plus css
import "element-plus/dist/index.css";

// dark mode
import "element-plus/theme-chalk/dark/css-vars.css";

/**
 * 注册全局 element plus & icons
 */
export const pluginElementPlus = {
    install: (app: App) => {
        app.use(ElementPlus);

        // 注册图标 es2017
        for (const [_key, _icon] of Object.entries(ElementPlusIcons)) {
            app.component(_key, _icon);
        }
    },
};
